var {
 queryDepartmentByPage,
} = require('../../utils/api');
const methods = require('../../utils/methods');
const app = getApp();

Page({

 data: {
  parentList: [],
  uname:'',
 },

 onLoad: function (options) {
  let _this = this;
  if (app.globalData.userInfo) { //老用户查询
   _this.setData({
     uname:app.globalData.userInfo.name
   })

 }
  //页面加载时事件类型 家庭类，环保类，违章违建类....
  queryDepartmentByPage(1, 200).then(res => {
   console.log('res==', res);
   let ary = res[1].content;

   _this.setData({
    parentList: ary
   })

  })


 },

 onShow: function () {

 },

 reserve(e) {
  console.log('111111', e.currentTarget.dataset.id);
  let id = e.currentTarget.dataset.id;
  let name = e.currentTarget.dataset.name;
  wx.navigateTo({
   url: "../personalnumberInfo/index?id=" + id + '&name=' + name,
  })

 }
})